package com.fh.shop.admin.biz.log;

import com.fh.shop.admin.param.log.LogQueryParam;
import com.fh.shop.admin.po.log.Log;
import com.fh.shop.admin.common.DataTableResult;
import com.fh.shop.admin.mapper.log.ILogMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("logInfoService")
public class ILogServiceImpl implements ILogService {

    @Autowired
    private ILogMapper logInfoMapper;

    @Override
    public void addLogInfo(Log log) {
        logInfoMapper.addLogInfo(log);
    }

    @Override
    public DataTableResult findLogList(LogQueryParam logQueryParam) {
        Long count = logInfoMapper.findCount(logQueryParam);
        List<Log> logList = logInfoMapper.findLogList(logQueryParam);
        return new DataTableResult(logQueryParam.getDraw(),count,count,logList);
    }
}
